home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
DockStrip
/
SdevFragStub.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-23
|
1KB
|
60 lines
#include <Gestalt.h>
#include <DCon.h>
#include <QuickDraw.h>
#include <MixedMode.h>
#include <A4Stuff.h>
#include <ControlStrip.h>
#include "DockStrip.h"
ProcInfoType __procinfo = sdevMain_ProcInfo;
SdevMainProcPtr gCallThroughSdevMain = (SdevMainProcPtr) 0xDEADBEEF;
SDockStripGlobals* gGlobalsPtr = nil;
pascal long main (
unsigned long message,
Handle prefsHandle,
Rect *statusRect,
GrafPtr statusPort)
{
Rect copy;
long result;
Boolean runModule;
static Boolean gotIndex = false;
static UInt32 index;
if (gGlobalsPtr == nil) {
Gestalt (dockStripGestalt, (SInt32*)&gGlobalsPtr);
}
if (gGlobalsPtr == nil) {
DebugStr ("\pGlobals not found in Gestalt");
}
// DebugStr ("\pSdev stub frag main");
if (!gotIndex) {
gCallThroughSdevMain = (SdevMainProcPtr) message;
for (index = 0; index < StubListSize; index++) {
if (gGlobalsPtr -> moduleList [index].module.procPtr == (ProcPtr) gCallThroughSdevMain) {
gotIndex = true;
return 0;
}
}
}
if (!gotIndex) {
DebugStr ("\pModule not found in the list");
}
result = BeforeModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, &runModule);
if (runModule) {
copy = *statusRect;
result = (*gCallThroughSdevMain) (message, prefsHandle, ©, statusPort);
result = AfterModule (gGlobalsPtr, index, message, prefsHandle, statusRect, statusPort, result);
}
return result;
}